-
Notifications
You must be signed in to change notification settings - Fork 212
Allow owners to change their subnet symbol #1770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devnet-ready
Are you sure you want to change the base?
Conversation
…e TokenSymbol directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I left a couple of minor questions.
) -> DispatchResult { | ||
Self::ensure_subnet_owner_or_root(origin, netuid)?; | ||
|
||
if SYMBOLS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good candidate for the function (you have a couple "symbols related functions" within this PR
return Err(Error::<T>::SymbolDoesNotExist.into()); | ||
} | ||
|
||
let used_symbols = TokenSymbol::<T>::iter_values().collect::<Vec<_>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the second unbounded iteration here. @gregzaitsev Do we care about weights optimizations here?
Description
Allow the subnet owner (and root) to change the subnet symbol if it exists and is not already in use.
During subnet creation, the next available symbol is determined by checking if the symbol for the given subnet ID is available. If it is not, the system iterates through the symbol list to find the next available one. If no symbols are available because the list is exhausted, the default symbol is used until the symbol list is extended.
Additionally, the symbol list is refactored to be static.
Related Issue(s)
Type of Change
Breaking Change
If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.
Checklist
cargo fmt
andcargo clippy
to ensure my code is formatted and linted correctlyScreenshots (if applicable)
Please include any relevant screenshots or GIFs that demonstrate the changes made.
Additional Notes
Please provide any additional information or context that may be helpful for reviewers.